package com.iengoo.edu;

/**
 * @author zpym
 * @CopyRight (C) http://www.iengoo.com
 * @brief 多态，编译时看左边(抽象出来，按照父类类型看待)，运行时看右边
 * @email 122162005@qq.com
 * @date 2019-01-22 10:01
 */
public class CatTest {
    public static void main(String[] args) {
        Cat cat = new Cat();
        Food fish = new Fish("金龙鱼", "鱼");
        // fish.setName("金龙鱼");
        cat.eat(fish);
        Food cookie = new Cookie("甜的甜甜圈", "甜点");
        cat.eat(cookie);
    }
}
